package dominioEntity;

import hbt.PersistentObject;

import java.sql.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

///Factura lado Servidor DAO (Persistencia)
@Entity
public class Factura extends PersistentObject {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int numero;
	private Date fecha;
	
	@OneToOne(cascade = CascadeType.ALL)
	@PrimaryKeyJoinColumn  (name="idCliente")
	private Cliente cliente;
	
	@LazyCollection(LazyCollectionOption.FALSE)
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name="idRemitoCliente")
	//private RemitoCliente remito;
	private float descuento;
	
	@LazyCollection(LazyCollectionOption.FALSE)
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name="idItemFactura")
	private List<ItemFactura> itemsFactura;
	
	@LazyCollection(LazyCollectionOption.FALSE)
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name="idItemCotizacion")
	private List<ItemCotizacion> itemsCotizados;
	private String estado;
	private float iva;
	private float ingBrutos;
	
	
	
	public Factura() {
		super();
		// TODO Auto-generated constructor stub
	}
	//Getters & Setters
	}
